load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "allocatorimpl",
    srcs = [
        "allocator.go",
        "allocator_scorer.go",
        "test_helpers.go",
        "threshold.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/allocator/allocatorimpl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/gossip",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/allocator",
        "//pkg/kv/kvserver/allocator/load",
        "//pkg/kv/kvserver/allocator/storepool",
        "//pkg/kv/kvserver/constraint",
        "//pkg/kv/kvserver/liveness",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/kv/kvserver/raftutil",
        "//pkg/raft",
        "//pkg/raft/raftpb",
        "//pkg/raft/tracker",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "allocatorimpl_test",
    srcs = [
        "allocator_scorer_test.go",
        "allocator_test.go",
    ],
    embed = [":allocatorimpl"],
    deps = [
        "//pkg/gossip",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/allocator",
        "//pkg/kv/kvserver/allocator/load",
        "//pkg/kv/kvserver/allocator/storepool",
        "//pkg/kv/kvserver/constraint",
        "//pkg/kv/kvserver/liveness",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/kv/kvserver/replicastats",
        "//pkg/raft",
        "//pkg/raft/raftpb",
        "//pkg/raft/tracker",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/testutils",
        "//pkg/testutils/gossiputil",
        "//pkg/util",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/stop",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_kr_pretty//:pretty",
        "@com_github_olekukonko_tablewriter//:tablewriter",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
